<template>
	<view style="width: 100vw;">
		<view class="">
			<image @click="imageClick" @load="imageLoad" style="width: 100%;" :src="imageSrc" mode="widthFix"></image>
		</view>
		<view v-show="showTips" style="width: 100vw;text-align: center; position: fixed; bottom:  10vh;">
			{{'提示：长按图片点击保存到手机'}}
		</view>
	</view>
</template>
<script>
	const app = getApp();
	export default {
		data() {
			return{
				imageSrc:'',
				showTips:false
			}
		},
		onLoad(options) {
			let _that = this
			_that.om.request(
				'commonForm/getFormPngPath',
				{
					formCode:options.formCode,
					fileId:options.fileId,
					isOuter:options.isOuter
				}
			).then(res=>{
				if(res.succeed && res.value){
					_that.imageSrc = (app.globalData.url + 'UPLOAD' + res.value).replace(/\\/g,"/")
				}
				uni.showLoading({
				})
			})
		},
		methods:{
			imageLoad(){
				let _that = this
				_that.showTips = true
				uni.hideLoading()
			},
			imageClick(){
				let _that = this
				uni.previewImage({
					current: 1,
					urls: [_that.imageSrc]  // 是个 数组 单张的（[this.img]），所有的 this.imglist
					// urls: this.picarr,
				});
			},
		}
	}
</script>
<style scoped>
	
</style>